package com.ubb.damate.util;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class DateUtils {

	public static Date createDate(int year, int month, int day) {
		GregorianCalendar calendar = new GregorianCalendar(year == -1 ? Calendar.getInstance().get(Calendar.YEAR) : year, month - 1, day);
		return calendar.getTime();
	}

	public static Integer getMonthFromDate(Date date) {
		GregorianCalendar calendar = new GregorianCalendar();
		calendar.setTime(date);
		return calendar.get(Calendar.MONTH);
	}

}